/*
 * 文件名：OrderByInfoServiceImp.java
 * 版权：Copyright by www.wootide.com
 * 描述：
 * 修改人：ozm
 * 修改时间：2013-1-28
 * 跟踪单号：
 * 修改单号：
 * 修改内容：
 */
package com.wootide.cms.service.facility.room.roomtype.service.imp;

import org.springframework.dao.DataAccessException;

import com.wootide.cms.common.ErrorCodes;
import com.wootide.cms.common.Page;
import com.wootide.cms.common.QueryCondition;
import com.wootide.cms.common.QueryResults;
import com.wootide.cms.common.Result;
import com.wootide.cms.log.syslog.RunLog;
import com.wootide.cms.service.facility.room.roomtype.dao.RoomTypeInfoDao;
import com.wootide.cms.service.facility.room.roomtype.service.RoomTypeInfoService;
import com.wootide.cms.service.facility.room.roomtype.transaction.RoomTypeInfoTransaction;

/**
 * 预订方式业务层实现层
 * 〈一句话功能简述〉
 * 〈功能详细描述〉
 * @author ozm
 * @version 2013-1-28
 * @see RoomTypeInfoServiceImp
 * @since 2013-1-28下午2:20:01
 */
public class RoomTypeInfoServiceImp implements RoomTypeInfoService
{
    // 注入运行日志
    private RunLog runLog;
    
    //用户事物层实例
    private RoomTypeInfoTransaction roomTypeInfoTransaction;
    
    //用户数据访问层实例
    private RoomTypeInfoDao roomTypeInfoDao;
    
    @Override
    public Result queryAllRoomTypeInfos()
    {// 定义返回结果
        Result result = new Result();
        try
        {
            QueryResults queryResults = roomTypeInfoDao.findAllRoomTypeInfos();
            result.setResultPojo(queryResults);
            result.setResultCode(ErrorCodes.ERRORCODE_SUCC);
            runLog.info("Query consumableTypeInfo Success!");
        }
        catch (DataAccessException e)
        {
            //数据库异常
            runLog.error("Query consumableTypeInfo Failed!", e);
            // 注册修改前的路由对象
            result.setResultCode(ErrorCodes.ERRORCODE_DATABASE);
        }
        
        catch (Exception e)
        {
            //异常
            runLog.error("Query consumableTypeInfo Failed!", e);
            // 注册修改前的路由对象
            result.setResultCode(ErrorCodes.ERRORCODE_UNKNOW);
        }
        return result;
    }
    
    @Override
    public Result queryForPages(Page page, QueryCondition queryConditon)
    {
        // TODO Auto-generated method stub
        return null;
    }
    
    public RunLog getRunLog()
    {
        return runLog;
    }
    
    public void setRunLog(RunLog runLog)
    {
        this.runLog = runLog;
    }
    
    public RoomTypeInfoTransaction getRoomTypeInfoTransaction()
    {
        return roomTypeInfoTransaction;
    }
    
    public void setRoomTypeInfoTransaction(
            RoomTypeInfoTransaction roomTypeInfoTransaction)
    {
        this.roomTypeInfoTransaction = roomTypeInfoTransaction;
    }
    
    public RoomTypeInfoDao getRoomTypeInfoDao()
    {
        return roomTypeInfoDao;
    }
    
    public void setRoomTypeInfoDao(RoomTypeInfoDao roomTypeInfoDao)
    {
        this.roomTypeInfoDao = roomTypeInfoDao;
    }


    
}
